package com.zhejiangzhengyuan.municipal_common.entity.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;


import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * @author lin_ju
 * @create on 2019/12/4
 */
@Data
@ApiModel(value = "消息显示封装类", description = "消息推送载体")
public class MessageVo {

  @ApiModelProperty("消息数量")
  private int count;


  @ApiModelProperty("message列表")
  private List<MessageDetail> messages;



  public void addDetail(MessageDetail messageDetail){
    if (Objects.isNull(this.messages)) {
      this.messages = new ArrayList<>();
    }
    this.messages.add(messageDetail);
  }

}
